<template>
    <div class="h-6" />
    <el-menu :default-active="activeIndex2" class="el-menu-demo" mode="horizontal" background-color="#545c64"
        text-color="#fff" active-text-color="#ffd04b" @select="handleSelect">
        <el-menu-item index="1">首页</el-menu-item>
        <el-menu-item index="1-2">博文</el-menu-item>
        <el-menu-item index="1-3">视频</el-menu-item>
        <el-sub-menu index="2">
            <template #title>下载</template>
            <el-menu-item index="2-1">行业软件</el-menu-item>
            <el-menu-item index="2-2">电子书软件</el-menu-item>
            <el-menu-item index="2-3">PCB参考设计</el-menu-item>
            <!-- <el-sub-menu index="2-4">
                <template #title>item four</template>
                <el-menu-item index="2-4-1">item one</el-menu-item>
                <el-menu-item index="2-4-2">item two</el-menu-item>
                <el-menu-item index="2-4-3">item three</el-menu-item>
            </el-sub-menu> -->
        </el-sub-menu>
        <el-menu-item index="4">行业动态</el-menu-item>
        <el-menu-item index="4-2">干货分享</el-menu-item>
        <el-sub-menu index="4-3">
            <template #title>课程</template>
            <el-menu-item index="4-4">PCB设计一板即成功专栏</el-menu-item>
            <el-menu-item index="4-5">PCB信仰工艺尺配套课程</el-menu-item>
        </el-sub-menu>
        <el-sub-menu index="5">
            <template #title>店铺</template>
            <el-menu-item index="5-1">站内商店</el-menu-item>
            <el-menu-item index="5-2">淘宝店</el-menu-item>
        </el-sub-menu>
        <el-sub-menu index="6">
            <template #title>注册与登录</template>
            <el-menu-item index="6-2" @click="gologin">登录</el-menu-item>
            <el-menu-item index="6-3">注册</el-menu-item>
        </el-sub-menu>
    </el-menu>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import { useRouter } from 'vue-router';
let router = useRouter()
function gologin() {
    router.push('/clogin')
}
const activeIndex = ref('1')
const activeIndex2 = ref('1')
const handleSelect = (key: string, keyPath: string[]) => {
    console.log(key, keyPath)
}
</script>
